home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pcmagwin.zip / CHANGER.DOC < prev    next >
Text File  |  1992-12-30  |  15KB  |  294 lines

  1. CHANGER.EXE (VERSION 1.0)            Copyright (c) 1992 by Douglas Boling
  2. -------------------------------------------------------------------------
  3.               First Published in PC Magazine January 26, 1993 (Utilities)
  4. -------------------------------------------------------------------------
  5.  
  6. CHANGER:
  7.  
  8.         CHANGER lets you give your Windows 3.1 desktop a different look
  9. every time you bring it up. It lets you choose from among the various
  10. wallpapers, color schemes, desktop patterns, and screen savers Windows
  11. provides (or that you may have added), and you can limit CHANGER's choices
  12. in each of the four categories. If you like only the ``Flying Windows''
  13. and ``Rockets'' screen savers, you can tell CHANGER to select between
  14. those two only. Indeed, if you don't use a wallpaper or desktop pattern
  15. at all, you can tell CHANGER to ignore those (or any) particular categories.
  16.  
  17.      You can also configure CHANGER to present your chosen selections
  18. in sequence. If you want to use a specific color scheme for each day of
  19. the week, simply choose your five favorite combinations (seven if you're
  20. self-employed) and select CHANGER's sequential change option. If you'd
  21. rather take your chances, you can have CHANGER make any or all of its
  22. category choices at random.
  23.  
  24.      Because CHANGER uses some of the function calls that are new in
  25. Windows 3.1, a dialog box indicating that a newer version of Windows
  26. is required will pop up if you try to run the utility under Windows 3.0.
  27.  
  28.      To recompile the program after making changes of your own, you'll
  29. need either the Borland C++ 3.1 compiler or Microsoft C 6.0 compiler and
  30. the Windows SDK.
  31.  
  32.      USING CHANGER
  33.  
  34.      It takes only a few minutes to install and configure CHANGER;
  35. thereafter it will run automatically.  To install the utility, open the
  36. Startup Group in your Program Manager.  Select the File New menu item
  37. and then choose Program Item.  As the Description, fill in the title of
  38. the program as you want it to appear under the icon.  Then, on the
  39. command line, enter the complete path and executable filename, followed
  40. by /C.  The /C command line switch tells CHANGER to change the desktop
  41. per your configuration instructions and then terminate.
  42.  
  43.      Thus, if you keep CHANGER in your PCMAG directory on your C: drive,
  44. you would enter 
  45.  
  46.                  C:\PCMAG\CHANGER /C
  47.  
  48. on the command line.
  49.  
  50.      To configure CHANGER, just run CHANGER using the File Run menu
  51. selection in the Program Manager, but without the /C switch.  When you
  52. start CHANGER without the /C parameter, it displays a dialog box with 4
  53. choices:  Colors, Wallpaper, Screen Saver, and Desktop Pattern.
  54.  
  55.      To select a category, just double-click on its icon or select
  56. Configure. Keyboard users can use hotkeys (Ctrl-C for Colors, Ctrl-W for
  57. Wallpaper, Ctrl-S for Screen Savers, Ctrl-P for Patterns) instead.
  58. (If you make frequent changes to your CHANGER configuration, you might
  59. want to add a CHANGER Icon to the Program Manager that omits the /C on
  60. the command line.  This will allow you quick access to the CHANGER
  61. configuration dialog.)
  62.  
  63.      When you select a category, CHANGER brings up a dialog box with two
  64. list boxes and a number of buttons.  The first list box contains all
  65. possible selections for that category.  The second list box (initially
  66. empty) contains the set of selections from which you want CHANGER to
  67. pick.  The Add, Rem (Remove), Add All, and Rem All (Remove All) buttons
  68. let you move selections back and forth between the list boxes.
  69.  
  70.      For example, when configuring the Colors category, CHANGER presents
  71. a list that contains both the color combinations predefined by Windows
  72. and those you may have created.  To add a given color scheme to the list
  73. of active selections, just select that scheme in the list box and click
  74. on the Add button.  (If you like shortcuts, double-clicking on an item
  75. will add it to the active list.)
  76.  
  77.      CHANGER will remove that combination from the Possible list and
  78. place it in the Active list.  To remove a color scheme from the Active
  79. list, double-click on the item or select that item and press the Rem
  80. button.  The Add All and Rem All buttons give you a quick way to move
  81. all selections between the list boxes.
  82.  
  83.      Below the Possible and Active list boxes, the Configure dialog box
  84. contains three radio buttons.  The Random Change button tells CHANGER
  85. to select an item at random from the Active list each time you start
  86. Windows. Selecting Sequential Change tells CHANGER to select an item
  87. sequentially from the Active list each time you start Windows.  The No
  88. Change button tells CHANGER not to change that particular category.
  89. After you specify your configuration, click on the OK button to save
  90. your changes; the Cancel button tells CHANGER to ignore your changes.
  91.  
  92. EXPLORING THE WINDOWS DESKTOP
  93.  
  94.      How does Windows know which color pattern, wallpaper, and screen
  95. saver to use when it starts? WIN.INI and SYSTEM.INI, the most important
  96. of the .INI files, store a variety of settings for such things as the
  97. position of windows, the type of video driver to load, and--you guessed
  98. it--the colors settings, wall paper, and screen saver used by Windows.
  99.  
  100.      The .INI files are organized into sections whose names are enclosed
  101. in square brackets.  Within each section there are usually several keys
  102. (key words), each of which is set equal to a value.  For example, the
  103. WIN.INI file has a section called [Desktop] that includes Pattern,
  104. IconSpacing, and Wallpaper keys. The Figure below is a partial listing
  105. of my own WIN.INI file, showing the [Desktop] and the [Colors] sections.
  106.  
  107. -------------------------------------------------------------------------
  108. [Desktop]
  109. Pattern=136 84 34 69 136 21 34 81
  110. TileWallpaper=1
  111. GridGranularity=0
  112. IconSpacing=65
  113. Wallpaper=SQUARES.BMP
  114.  
  115. [Colors]
  116. Background=0 64 128
  117. AppWorkspace=192 192 192
  118. Window=192 192 192
  119. WindowText=0 0 0
  120. Menu=192 192 192
  121. MenuText= 0 0 0
  122. ActiveTitle=64 128 128
  123. InactiveTitle=192 192 192
  124. TitleText=255 255 255
  125. ActiveBorder=128 0 0
  126. Inactive Border=130 130 130
  127. WindowFrame=0 0 0
  128. Scrollbar=128 128 128
  129. ButtonFace=192 192 192
  130. ButtonShadow=128 128 128
  131. ButtonText=0 0 0
  132. GrayText=192 192 192
  133. Hilight=0 0 0
  134. HilightText=255 255 255
  135. InactiveTitleText=0 0 0
  136. ButtonHilight=255 255 255
  137.  
  138. Figure: A partial WIN.INI file, showing the [Desktop] and [Colors] sections
  139. and the keys listed in both.
  140. -----------------------------------------------------------------------
  141.  
  142.      The [Colors] section specifies the color settings for every part of
  143. Windows, from backgrounds to button text.  The value for each key is a
  144. set of three numbers, separated by spaces, that represent the Red, Blue,
  145. and Green components that are combined to produce the color. On my system,
  146. the color of the title bar for the active window is specified by the
  147. following line:
  148.  
  149.                  ActiveTitle=64  128  128
  150.  
  151.       In this line, 64 represents the value of the Red component, 128
  152. is the value of the Green component, and the final number, 128, is the
  153. value of the Blue component.  The amounts of each component may range
  154. from 0 to 255, with 0 indicating that none of that color is added and
  155. 255 meaning that the maximum amount of that primary color is added.
  156.  
  157.      If you're used to thinking in artistic terms, calling Red, Green,
  158. and Blue ``primary colors'' may come as a surprise.  When using paints
  159. or pigments, the three primary colors are Red, Blue, and Yellow.  The
  160. explanation is that paints absorb the different wavelengths of light
  161. while the rays that come from the sun or that illuminate a computer
  162. monitor are light, whose red, green, and blue components, added together
  163. in maximum amounts, produce white.  Other combinations of the three
  164. primaries produce other colors:  red and green make yellow, blue and
  165. green produce cyan, and so on.
  166.  
  167.      If you look at the individual colors specified in the WIN.INI file,
  168. however, something seems to be missing.  When you use the Control Panel
  169. to change your desktop color scheme you see names, such as Arizona,
  170. Pastel, or--strangely enough--Hotdog Stand.  Each of these represents
  171. a numeric color combination.  Selecting Pastel, for instance, changes
  172. the entire desktop into a rainbow of subdued blues, greens, and yellows.
  173.  
  174.      The translation table between the names and numbers is contained
  175. in the [Color Schemes] section of the CONTROL.INI file.  Here, each of
  176. the color combinations consists of a series of 21 numbers that represent
  177. all of the individual color settings used by Windows.  Unlike the color
  178. values listed in the WIN.INI file, however, these numbers are in
  179. hexadecimal (base 16) format and are separated by commas.  For example,
  180. the Pastel key in my CONTROL.INI file is
  181.  
  182.  
  183. Pastel=C0FF82,80FFFF,FFFFFF,0,
  184. FFFFFF,0,FFFF80,FFFFFF,0,C080FF,
  185. FFFFFF,808080,C0C0C0,C0C0C0,
  186. 808080,0,C0C0C0,FFFF00,0,0,FFFFFF
  187.  
  188.      Each of these hexadecimal numbers represents the setting for a
  189. particular color.  The first number is the Background color, the second
  190. is the Application Workspace color, and so on.  When you select the
  191. Pastel setting from the Control Panel, Windows takes the colors listed
  192. and translates them into the color settings in the WIN.INI file.
  193. For example, the starting number C0FF82 would be broken into three
  194. hexadecimal numbers--C0 FF 82--which translate into the decimal values
  195. 192 255 130, which are then used to set the Background color.  In the
  196. WIN.INI file the line would read
  197.  
  198.  
  199. Background=130  255  192
  200.  
  201.  
  202.      The Desktop Pattern is the little design that Windows uses when it
  203. draws the desktop window.  To get an idea of the different desktop
  204. patterns, open the Desktop Control Panel applet, select (none) for the
  205. Wallpaper, choose one of the many patterns listed, and click OK.  You'll
  206. see the selected pattern tiled across your Windows desktop.  You can then
  207. check out the different available patterns, or you can even make one of
  208. your own by clicking on the Edit Pattern button.  Unfortunately,  the
  209. original way if you tile your wallpaper, as I do, you'll only see the
  210. desktop pattern as the background of the icon text on the bottom of the
  211. screen.
  212.  
  213.      The pattern is actually a bitmap that Windows creates from a series
  214. of numbers.  The numbers represent an 8- by 8-pixel bitmap that tells
  215. Windows to use either the Background color (a 0-bit in the pattern) or
  216. the WindowText color (a 1-bit in the pattern) for each specific pixel.
  217. The pattern is repeated across the entire screen to draw the desktop.
  218.  
  219.       An example may make this clearer.  One of the available patterns,
  220. called Tulip, is represented by the numbers 0 0 84 124 124 56 146 124.
  221. Each of these numbers represents one 8-bit line in the bitmap.  If you
  222. write each of the numbers on a separate line and in binary, the tulip
  223. pattern formed by the 1 bits will become evident, as shown in the Figure
  224. below.
  225.  
  226.          OOOOOOOO
  227.          OOOOOOOO
  228.          O1O1O1OO
  229.          O11111OO
  230.          O11111OO
  231.          OO111OOO
  232.          1OO1OO1O
  233.          O11111OO
  234.  
  235.       As with the window colors, the current pattern is specified by the
  236. eight numbers assigned to the Pattern key in the [Desktop] section of
  237. the partial WIN.INI file listing above.  As with the color combinations,
  238. the names of the possible patterns (Tulip, Weave, Boxes, and so on) are
  239. listed in the CONTROL.INI file, together with their 8-number values.
  240. If you use the Control Panel to create your own pattern, its key and
  241. values will also be written into the [Patterns] section of CONTROL.INI.
  242. If you don't specify a pattern, the string  will be assigned to the
  243. Pattern key.
  244.  
  245.      Wallpaper is a bitmap picture that Windows uses to cover the desktop.
  246.  The picture can be  centered in the desktop or it can be ``tiled,'' by
  247. repeating the bitmap so that it covers the entire screen. 
  248. (To tile a 64- by 64-pixel bitmap on a 1,024-by-768 screen, Windows must
  249. repeat the bitmap 192 times.)  Unlike the bitmap used to make the Desktop
  250. pattern, the wallpaper picture is stored as a bitmap (.BMP) file and can
  251. be in color.
  252.  
  253.       Instead of specifying numbers, as with the Colors and Pattern
  254. settings, the Wallpaper key in the [Desktop] section of WIN.INI contains
  255. the filename of the bitmap to be used for the wallpaper.  Also unlike the
  256. Colors and the Pattern, the names of other possible Wallpaper bitmaps are
  257. not stored in the CONTROL.INI file.  Instead, the Control Panel lists all
  258. the .BMP files in the Windows and Windows System directories as possible
  259. wallpaper files.  Thus, when you select a wallpaper bitmap, Windows simply
  260. sets the Wallpaper key in [Desktop] to the name of the bitmap file.
  261.  
  262.       The Windows Screen Saver was one of the new features added to
  263. Windows 3.1.  In reality, Microsoft simply bundled the screen-saver
  264. application from the old Multimedia Windows, moving its setup from the
  265. screen-saver applet in the Control Panel to the Desktop applet.  Once
  266. set, Windows automatically starts the screen saver after a predetermined
  267. period of machine inactivity.
  268.  
  269.      Screen savers are not bitmaps, but program files.  The selected
  270. screen saver is specified in the [Boot] section of the SYSTEM.INI file,
  271. as the value for the SCRNSAVE.EXE key.  Although the Screen Saver line
  272. can include a path to another directory, screen savers are normally kept
  273. in the Windows directory, the Windows System directory, or the directory
  274. of the Control Panel application, since these are the only places the
  275. Control Panel knows to look for them.
  276.  
  277.      At the same time that the Control Panel stores the screen-saver
  278. filename and path in SYSTEM.INI, two lines in the WIN.INI file are also
  279. modified.  The ScreenSaveTimeOut and ScreenSaveActive keys in the
  280. [Windows] section of WIN.INI are updated to indicate that a screen saver
  281. is active and the time to elapse before it becomes active.
  282.  
  283.      If you look at the list of screen savers presented by the Control
  284. Panel's Desktop applet, you won't see a list of the usual eight-character
  285. filenames.  Instead, you'll see descriptive screen-saver designations
  286. that include upper- and lowercase characters and even spaces.  This is
  287. because the Desktop applet doesn't use the filename of the screen saver;
  288. rather, it reads the description line imbedded inside the screen-saver
  289. program to get the name of the screen saver.  This enables Windows to
  290. present you with nice descriptive names from which to choose while
  291. storing the actual filename of your choice in the SYSTEM.INI file.
  292. ------------------------------------------------------------------------
  293. DOUGLAS BOLING IS A CONTRIBUTING EDITOR TO PC MAGAZINE.
  294.